package com.example.springboot_code_read.print;

import org.springframework.format.Printer;

import java.text.NumberFormat;
import java.util.Locale;

public class CurrencyPrinter implements Printer<Number> {

    @Override
    public String print(Number object, Locale locale) {
        NumberFormat numberFormat = NumberFormat.getCurrencyInstance(locale);
        return numberFormat.format(object);
    }

}
